

********Replication for Emotionally Coping with Terrorism*********


**************************Figure 1*************************************

******Instructions:****** 
**1. Install combomarginsplot and grc1leg
findit combomarginsplot
findit grc1leg
**2. To run analysis for Study 1, Open 2017_CCES_data.dta, run up to beginning of ***Study 2**** (line )
**3. Next, run the analysis for Study 2, Open 2018_MTurk_data.dta, run up to the beginning of ***Study 3***, (line )
**4. Finally, run the analysis for Study 3, Open 2020_MTurk_data.dta, and run through the end of the do file. 



******Study 1 (left panel)********

******************************************
********Open 2017_CCES_data.dta********
******************************************

**set weights
svyset [pweight=weights_ucr]

***create anger vs. control article variable**
tab ucr_article_treat
gen angvcontr=ucr_article_treat
recode angvcontr (1=0) (2=0) (3=1) (4=1) (5=1)
tab angvcontr


*****Recode Anger Variables

***Anger at Time 1
tab ucr338
gen anger1=ucr338
recode anger1 (1=1) (2=.66) (3=.33) (4=0) 
tab anger1

***Anger at Time 2
tab ucr342
gen anger2=ucr342
recode anger2 (1=1) (2=.66) (3=.33) (4=0) 
tab anger2


*****Recode Fear Variables 0 - 1

***Fear at Time 1
tab ucr339
gen fear1=ucr339
recode fear1 (1=1) (2=.66) (3=.33) (4=0) 
tab fear1

***Fear at Time 2
tab ucr343
gen fear2=ucr343
recode fear2 (1=1) (2=.66) (3=.33) (4=0) 
tab fear2


*****Recode Enthusiasm Variable 0-1

***Enthusiasm at Time 1
tab ucr340
gen enthu1=ucr340
recode enthu1 (1=1) (2=.66) (3=.33) (4=0) 
tab enthu1

***Enthusiasm at Time 2
tab ucr344
gen enthu2=ucr344
recode enthu2 (1=1) (2=.66) (3=.33) (4=0) 
tab enthu2


**Manipulation Check***
svy: mean anger1, over(angvcontr) 
svy: reg anger1 angvcontr

svy: mean fear1, over(angvcontr) coefl
svy: reg fear1 angvcontr

svy: mean fear1 anger1 if angvcontr==1, coefl
test [fear1]=[anger1]

svy: mean enthu1, over(angvcontr) coefl
svy: reg enthu1 angvcontr


********Figure 2 Left Panel: Mean Anger at T1 and T2 in Study 1*********

***create coping condition variable among those in anger condition
tab ucr_article_treat
gen angcope=ucr_article_treat
recode angcope (1=.) (2=.) (3=0) (4=.) (5=1)
tab angcope
***0=Confront 1=Distancing


reg anger1 i.angcope [pweight=weights_ucr]
margins angcope, saving(t1_anger_con_2017, replace)

sleep 1000

reg anger2 i.angcope [pweight=weights_ucr]
margins angcope, saving(t2_anger_con_2017, replace)

sleep 1000

*****Need to install combomarginsplot for this figure****
findit combomarginsplot
***************************

#delimit ;
combomarginsplot t1_anger_con_2017 t2_anger_con_2017,
recast(scatter) byopt(r(1))  title("Study 1")
plot1opts(mcolor(black) msymbol(circle_hollow) msize(medlarge) lcolor(black) lpat(dash)) ci1opts(msymbol(oh) lcolor(black) lpat(dash))
plot2opts(mcolor(black) lcolor(black) msize(medlarge) lpat(solid)) ci2opts(lcolor(black) lpat(solid))
xlabel(0 `" "Problem-Focused" "(Confrontation -" "Act on Terrorism)" "' 1  `" "Emotion-Focused" "(Distancing - " "No Opportunity to Act)" "', labsize(3.5)) xtitle("") xscale(r (-.5 1.5))
ylabel( 0(.1).8, axis(1) nogrid labsize(2)) ytitle("Mean Anger") 
legend(order(3 "Anger at Time 1" 4 "Anger at Time 2") size(small)  )
graphregion(color(white)) name(fig2_study1, replace);

#delimit cr


*******Difference in Reduction in Anger for Problem-Focused vs. Emotion-Focused***********

***create difference in anger variable
gen diffanger=anger1-anger2

reg diffanger i.angcope [pweight=weights_ucr]
margins angcope
margins r.angcope



******Study 2 (middle panel)********

******************************************
********Open 2018_MTurk_data.dta********
******************************************


***create variable for anger vs. control article condition
tab condition
gen angvcontr=condition
recode angvcontr (1=1) (2=1) (3=1) (4=1) (5=0) (6=0) (7=0)
tab angvcontr 

******Recode anger variables 0 - 1

***Anger at T1
tab angert1
gen anger1=angert1
recode anger1 (1=1) (2=.66) (3=.33) (4=0) 
tab angert1
tab anger1

***Anger at T2
tab angert2
gen anger2=angert2
recode anger2 (1=1) (2=.66) (3=.33) (4=0) 
tab angert2
tab anger2


******Recode fear variables 0 - 1

***Fear at T1
tab feart1
gen fear1=feart1
recode fear1 (1=1) (2=.66) (3=.33) (4=0) 
tab feart1
tab fear1

***Fear at T2
tab feart2
gen fear2=feart2
recode fear2 (1=1) (2=.66) (3=.33) (4=0) 
tab feart2
tab fear2

*****Recode Enthusiasm Variables 0-1

***Enthusiasm at T1
tab enthut1
gen enthu1=enthut1
recode enthu1 (1=1) (2=.66) (3=.33) (4=0) 
tab enthut1
tab enthu1

***Enthusiasm at T2
tab enthut2
gen enthu2=enthut2
recode enthu2 (1=1) (2=.66) (3=.33) (4=0) 
tab enthut2
tab enthu2

*****Manipulation Check****
ttest anger1, by(angvcontr)

ttest fear1, by(angvcontr)

ttest anger1=fear1 if angvcontr==1

ttest enthu1, by(angvcontr)


********Figure 2 Middle Panel: Mean Anger at T1 and T2 in Study 2*********

*********create variable for coping strategies among those in anger condition
gen angcope=condition
recode angcope (3=2) (2=1) (4=.) (1=0) (5=.) (6=.) (7=.)
tab angcope
****0=confront terrorism 1=act on transportation 2= no opportunity to act

**2018 Anger at T1 and T2****

reg anger1 i.angcope
margins angcope, saving(t1_anger_con_2018, replace)

sleep 1000

reg anger2 i.angcope
margins angcope, saving(t2_anger_con_2018, replace)

sleep 1000

#delimit ;
combomarginsplot t1_anger_con_2018 t2_anger_con_2018,
recast(scatter) byopt(r(1))  title("Study 2")
plot1opts(mcolor(black) msymbol(circle_hollow) msize(medlarge) lcolor(black) lpat(dash)) ci1opts(msymbol(oh) lcolor(black) lpat(dash))
plot2opts(mcolor(black) lcolor(black) msize(medlarge) lpat(solid)) ci2opts(lcolor(black) lpat(solid))
xlabel(0 `" "Problem-Focused" "(Confrontation -" "Act on Terrorism)" "' 1`" "Emotion-Focused" "(Distancing - " "Act on Transportation)" "' 2 `" "Emotion-Focused" "(Distancing - " "No Opportunity to Act)" "' , labsize(3.5)) xtitle("") xscale(r (-.5 2.5))
ylabel( 0(.1).8, axis(1) nogrid labsize(2)) ytitle("Mean Anger") 
legend(order(3 "Anger at Time 1" 4 "Anger at Time 2"))
graphregion(color(white)) name(fig2_study2, replace);

#delimit cr


*******Difference in Reduction in Anger for Problem-Focused vs. Emotion-Focused***********

***create difference in anger variable
gen diffanger=anger1-anger2

reg diffanger i.angcope 
margins angcope
margins r.angcope
margins ar.angcope



******Study 3 (right panel)********

******************************************
********Open 2020_MTurk_data.dta********
******************************************


***create variable for anger vs. control article condition
tab condition
gen angrcon=condition
recode angrcon (1=1) (2=0)
tab angrcon condition


******Recode anger variables 0 - 1

***Anger at T1
tab anger1
gen angert1=anger1
recode angert1 (1=1) (2=.66) (3=.33) (4=0) 
tab angert1
tab anger1


***Anger at T2
tab anger2
gen angert2=anger2
recode angert2 (1=1) (2=.66) (3=.33) (4=0) 
tab angert2
tab anger2


******Recode fear variables 0 - 1

***Fear at T1
tab afraid1
gen feart1=afraid1
recode feart1 (1=1) (2=.66) (3=.33) (4=0) 
tab feart1
tab afraid1

***Fear at T2
tab afraid2
gen feart2=afraid2
recode feart2 (1=1) (2=.66) (3=.33) (4=0) 
tab afraid2
tab feart2

*****Recode Enthusiasm Variables 0-1

***Enthusiasm at T1
tab enthus1
gen enthust1=enthus1
recode enthust1 (1=1) (2=.66) (3=.33) (4=0) 
tab enthus1
tab enthust1

***Enthusiasm at T2
tab enthus2
gen enthust2=enthus2
recode enthust2 (1=1) (2=.66) (3=.33) (4=0) 
tab enthust2
tab enthus2


*****Manipulation Check****
ttest angert1, by(angrcon)
ttest feart1, by(angrcon)
ttest angert1=feart1 if angrcon==1
ttest enthust1, by(angrcon)



********Figure 2 Right Panel: Mean Anger at T1 and T2 in Study 3*********

*********create variable for coping strategies among those in anger condition
tab acon
gen angcope=.
replace angcope=0 if angrcon==1 & acon==1
replace angcope=1 if angrcon==1 & acon==2
replace angcope=2 if angrcon==1 & acon==3
tab angcope
****0=confront terrorism 1=act on transportation 2=control


reg angert1 i.angcope
margins angcope, saving(t1_anger_con_2020, replace)

sleep 1000

reg angert2 i.angcope
margins angcope, saving(t2_anger_con_2020, replace)

sleep 1000

#delimit ;
combomarginsplot t1_anger_con_2020 t2_anger_con_2020,
recast(scatter) byopt(r(1))  title("Study 3")
plot1opts(mcolor(black) msymbol(circle_hollow) msize(medlarge) lcolor(black) lpat(dash)) ci1opts(msymbol(oh) lcolor(black) lpat(dash))
plot2opts(mcolor(black) lcolor(black) msize(medlarge) lpat(solid)) ci2opts(lcolor(black) lpat(solid))
xlabel(0 `" "Problem-Focused" "(Confrontation -" "Act on Terrorism)" "' 1`" "Emotion-Focused" "(Distancing - " "Act on Transportation)" "' 2 `" "Control" "(No Coping Strategy)" "' , labsize(3.5)) xtitle("") xscale(r (-.5 2.5))
ylabel( 0(.1).8, axis(1) nogrid labsize(2)) ytitle("Mean Anger") 
legend(order(3 "Anger at Time 1" 4 "Anger at Time 2"))
xsize(5.5)
graphregion(color(white)) name(fig2_study3, replace);

#delimit cr


***create difference in anger variable
gen diffanger=angert1-angert2

reg diffanger i.angcope 
margins angcope
margins r.angcope


****Figure 2 Combined:  Combine figures for studies 1-3***

*****need to install grc1leg for this figure****
findit grc1leg
***********

grc1leg fig2_study1 fig2_study2 fig2_study3, row(1) graphregion(color(white)) imargin(tiny) iscale(.7) ycommon name(figure_2, replace)

graph display figure_2, xsize(11)

graph export Figure_2.png,  replace height(1000)